public class Tower0fHanoi {
    public static void main(String[] args) {
        remove(3,'a','b','c');

    }

    public static void remove(int n,char a, char b, char c) {
        if (n == 1) {
            System.out.println( a + "->" + c);
            return;
        }
        remove(n-1,a,c,b);
        System.out.println(a + "->" +c);
        remove(n-1,b,a,c);
    }
}
